import { Component, OnInit, Input } from '@angular/core';
import { TabComponent } from '../tab-details';
import { HttpClient } from '@angular/common/http';

@Component({
    templateUrl: './tab-process.component.html',
    styleUrls: ['./tab-process.component.scss']
})
export class TabProcessComponent implements OnInit, TabComponent {
    @Input() data: any;

    cols: any[] = [
        { field: 'actionTime', header: '操作时间', style: { 'width': '20%', 'text-align': 'center' } },
        { field: 'humanName', header: '处理人', style: { 'width': '10%', 'text-align': 'center' } },
        { field: 'actDefName', header: '处理环节', style: { 'width': '15%', 'text-align': 'center' } },
        { field: 'detail', header: '详细信息', style: { 'width': '25%', 'text-align': 'center' } },
        { field: 'itemContent', header: '处理意见', style: { 'width': '30%', 'text-align': 'center' } },
    ];
    /**流程操作实例 */
    wfItemInst: any[];

    constructor(
        private http: HttpClient
    ) { }

    ngOnInit() {
        this.http.get('/'+this.data.systemUrl+'/api/tab/workflow/listprocess?recId=' + this.data.recId + '&actId=' + this.data.actId).subscribe(data => this.wfItemInst = data['data']);
    }

}
